import http from '@/utils/request.js'
export default {
register:(obj)=> {
    return http({
            url:'/api/user/register',
            method:'post',
            data: obj,
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        }
        )
  },
login:(obj)=> {
    return http({
            url:'/api/user/login',
            method:'post',
            data: obj,
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        }
        )
  },
logout:()=> {
    return http({
            url:'/api/user/logout',
            method:'get',
        }
        )
  },
    adminLogin:(obj)=> {
        return http({
                url:'/api/admin/login',
                method:'post',
                data: obj,
                headers: {
                    //定义将数据以json的形式传入后台(java)
                    'Content-Type': 'application/json'
                }
            }
        )
    },
    adminLogout:()=> {
        return http({
                url:'/api/admin/logout',
                method:'get',
            }
        )
    },
    sendEmailCode: (email) => {
        return http({
            url: `/api/user/emailCode/${email}`,
            method: 'get',
        })
    }
}